
#import "SMMineFavoritesViewController.h"
#import "SMListCardCell.h"
#import <Masonry/Masonry.h>
@implementation SMMineFavoritesViewController {
    NSArray *_data;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.title=@"我的收藏";
    self.view.backgroundColor=UIColor.systemGroupedBackgroundColor;
    self.tableView.backgroundColor=UIColor.systemGroupedBackgroundColor;
    self.tableView.separatorStyle=UITableViewCellSeparatorStyleNone;
    [self.tableView registerClass:SMListCardCell.class forCellReuseIdentifier:@"cell"];
    NSMutableArray *arr=[NSMutableArray array];
    for(int i=0;i<18;i++){
        NSString *img=[NSString stringWithFormat:@"https://picsum.photos/seed/fav_%d/520/360", i];
        NSString *title=[NSString stringWithFormat:@"收藏的资讯/供求 #%d", i+1];
        NSString *sub = @"含量高、杂质少、支持上门验货，长期合作～";
        NSString *meta=@"苏州 · 09-10 14:20";
        [arr addObject:@{@"img":img,@"title":title,@"sub":sub,@"meta":meta}];
    }
    _data=arr; [self.tableView reloadData];
}
- (NSInteger)tableView:(UITableView*)t numberOfRowsInSection:(NSInteger)s{ return _data.count; }
- (CGFloat)tableView:(UITableView*)t heightForRowAtIndexPath:(NSIndexPath*)i{ return 110; }
- (UITableViewCell*)tableView:(UITableView*)t cellForRowAtIndexPath:(NSIndexPath*)i{
    SMListCardCell *c=[t dequeueReusableCellWithIdentifier:@"cell" forIndexPath:i];
    NSDictionary *d=_data[i.row];
    [c configureWithImageURL:d[@"img"] title:d[@"title"] subtitle:d[@"sub"] meta:d[@"meta"]];
    return c;
}
@end
